﻿<Window x:Class="Topics.Radical.Presentation.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:markup="http://schemas.topics.it/wpf/radical/windows/markup"
        xmlns:rg="http://schemas.topics.it/wpf/radical/windows/presentation/regions"
        xmlns:aero="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
        Title="MainView" Height="600" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="35*" MinWidth="250"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="75*" MinWidth="400" />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding Path=SelectedSample.Title}" />
        
        <ScrollViewer Grid.Column="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Grid.RowSpan="2">
            <ItemsControl ItemsSource="{Binding Path=Categories}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Path=Name}" />
                            <ItemsControl Margin="10,0,0,0" ItemsSource="{Binding Path=Samples}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock>
                                            <Hyperlink Command="{markup:AutoCommandBinding Path=ViewSample}">
                                                <TextBlock Text="{Binding Path=Title}" />
                                            </Hyperlink>
                                        </TextBlock>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
        <GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="3" Grid.RowSpan="2" />

        <Border Margin="0"
                Padding="8"
                BorderThickness="0" 
                Background="LightGray" 
                Grid.Column="2" 
                Grid.Row="1">
            <aero:SystemDropShadowChrome>
                <Border BorderThickness="1" Background="White" BorderBrush="LightGray">
                    <ContentPresenter
						  HorizontalAlignment="Stretch" 
						  VerticalAlignment="Stretch" 
						  rg:RegionService.Region="{rg:ContentPresenterRegion Name=SampleContentRegion}" />
                </Border>
            </aero:SystemDropShadowChrome>
        </Border>
    </Grid>
</Window>
